﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace TravelingSalesmanEvolution
{
    class graph
    {
        int points;
        public int tmp;
        public Tuple<String, int, Tuple<int, int>[]>[] poi;
        //Tuple<>[] poi;

        //ArrayList<Tuple<String, int, List<Tuple<int, int>>>> poi;

        public graph(int p)
        {
            points = p;
            poi = new Tuple<String, int, Tuple<int, int>[]>[points];
            tmp = 0;
        }

        public void addTuple(String n, int c, int t)
        {
            if (tmp < points)
            {
                poi[tmp] = Tuple.Create<String, int, Tuple<int, int>[]>(n, c, new Tuple<int, int>[t]);
                tmp++;
            }
        }

        public void addRoad(int t, int d, int c)
        {
            if (tmp/2 < poi[t].Item3.Count())
            {
                poi[t].Item3[tmp/2] = Tuple.Create<int, int>(d, c);
                tmp += 2;
            }
        }

        public String show()
        {
            String temp = "\n";

            foreach (var po in poi)
            {
                temp += po.Item1 + ", profit " + po.Item2 + ", drogi:\n";
                foreach (var pe in po.Item3)
                {
                    temp += pe.Item1 + " - " + pe.Item2 + "; ";
                }
                temp += "\n";
            }
            return temp;
        }


        ~graph()
        {

        }










    }
}
